
let x ;

// 如果省略或值0，-0，null，false，NaN，undefined，或空字符串（""），该对象具有的初始值 false

x = new Boolean();
console.log( x , typeof( x ) ); // [Boolean: false] object

x = new Boolean( 0 );
console.log( x , typeof( x ) ); // [Boolean: false] object

x = new Boolean( -0 );
console.log( x , typeof( x ) ); // [Boolean: false] object

x = new Boolean( null );
console.log( x , typeof( x ) ); // [Boolean: false] object

x = new Boolean( false );
console.log( x , typeof( x ) ); // [Boolean: false] object

x = new Boolean( NaN );
console.log( x , typeof( x ) ); // [Boolean: false] object

x = new Boolean( undefined );
console.log( x , typeof( x ) ); // [Boolean: false] object

x = new Boolean( "" );
console.log( x , typeof( x ) ); // [Boolean: false] object

console.log( '- - - - - - - - - - - - - - - - - -' );

// 所有其他值，包括任何对象，空数组（[]）或字符串"false"，都会创建一个初始值为true的对象

let o = {}
let a = [] ;
let s = 'false' ;

x = new Boolean( o );
console.log( x , typeof( x ) ); // [Boolean: true] object

x = new Boolean( a );
console.log( x , typeof( x ) ); // [Boolean: true] object

x = new Boolean( s );
console.log( x , typeof( x ) ); // [Boolean: true] object
